package editorarquivobmg.model;

import java.io.File;
import java.io.FileOutputStream;

public class FLI1 implements ISalvamento {

    private byte[] data = null;
    private boolean valido = true;
    private int size = 0;

    public FLI1(byte[] data, int size, boolean valido) {
        this.valido = valido;
        this.data = data;
        this.size = size;
    }

    public int getSize() {
        return size;
    }

    @Override
    public void salvar(File file) throws Exception {
        if (valido) {
            FileOutputStream in = new FileOutputStream(file, true);
            in.write(data);
            in.close();
        }
    }
}
